<template>
  <rx-dialog @handOk="save" @cancel="cancel">
    <rx-layout>
      <div slot="center">
        <ExtendedProperties :propertiesGroups="propertiesGroups"></ExtendedProperties>
      </div>
    </rx-layout>
  </rx-dialog>

</template>

<script>
  import ExtendedProperties from './ExtendedProperties'
  import osPropertiesGroupApi from '@/api/user/org/osPropertiesGroup'
  import {RxLayout, Util,RxDialog } from "@lowcode/jpaas-common-lib"

  export default {
    name: "group-properties",
    components: {
      ExtendedProperties,
      RxLayout,
      RxDialog
    },
    props: {
      dimId: {
        type: String,
        default: ""
      },
      groupId: {
        type: String,
        default: ""
      },
      layerid: String,
      lydata: Object,
      destroy:Function
    },
    data() {
      return {
        propertiesGroups: []
      }
    },
    created() {
      this.getPropertiesGroups();
    },
    methods: {
      //获取组织维度扩展属性组
      getPropertiesGroups() {
        osPropertiesGroupApi.getAllProperties({dimId: this.dimId, ownerId: this.groupId}).then(res => {
          this.propertiesGroups = res;
        });
      },
      save() {
        Util.closeWindow(this, "ok",this.propertiesGroups);
      },
      cancel() {
        Util.closeWindow(this, "cancel");
      },
    }
  }
</script>

<style scoped>

</style>